from data_model.data_schemas import UserInfo


def empty_user_info_detect(user_info:UserInfo):
    empty_value_list = []

    key_map = {
        "birthday": "生日",
        "constellation":"星座",
        "user_question":"问题"
    }

    for key, value in dict(user_info).items():
        # 检查是否提取到所有用户信息
        if value == "":
            empty_value_list.append(key_map[key])
    if empty_value_list:
        empty_values_str = "、".join(empty_value_list)
        return f"您的{empty_values_str}为空,请重新输入完整需求哦。"
    else:
        return True


# user_info = {"birthday":"","constellation":"","user_question":"2"}
# print(empty_user_info_detect(user_info))
# def router_function():
#     if empty_user_info_detect(user_info):
#         return True
#     else:
#         return False
#
# if __name__ == '__main__':
#     user_info = {"birthday":"","星座":"双鱼座","question":"2"}
#     if router_function() == True:
#         print(empty_user_info_detect(user_info))
